/*
 * BorneAchatTicket.cpp
 *
 *  Created on: 10 mars 2011
 *      Author: Julien
 */

#include "BorneAchatTicket.h"
#include <iostream>

using namespace std;

BorneAchatTicket::BorneAchatTicket() {
	// On initialise le mutex d'achat de ticket
	pthread_mutex_init(&this->mutexAchat, 0);
}

// Un seul passager à la fois peut acheter un ticket. Mise en place d'un mutex
bool BorneAchatTicket::acheterUnTicket(){
	pthread_mutex_lock(&this->mutexAchat);
	cout << "Un ticket a été acheté" << endl;
	pthread_mutex_unlock(&this->mutexAchat);
	return true;
}

void BorneAchatTicket::rechargerAbonnement(){

}

BorneAchatTicket::~BorneAchatTicket() {
	// TODO Auto-generated destructor stub
}
